import java.util.*;


class com{

    String color ;
    Double price ;
    String cpu ;
    Double weight ;
    String brand  ;
    String model  ;

    public com(String color, Double price, String cpu, Double weight, String brand, String model) {
        this.color = color;
        this.price = price;
        this.cpu = cpu;
        this.weight = weight;
        this.brand = brand;
        this.model = model;
    }

    public String toString(){
        return  "电脑颜色"+color+",价格:"+price+",cpu:"+cpu+",重量："+weight+",品牌："+brand+",类型："+model;
    }

    public static synchronized void  a(){

    }
}
public class computer {
    public static void main(String[] args) {
        //创建一个集合
        List<com> list = new ArrayList<com>();

        //存入元素
        list.add(new com("red",45.0,"cpu2",1200.0,"dell","gx-3"));

        //遍历
        Iterator<com> it = list.iterator();
        for (int i=0;i<list.size();i++){
            System.out.println(list.get(i));
        }
    }
}
